<%@ page language="java" isELIgnored="false" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
     <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    	<link href="/admin/newTemplate/css/bootstrap.min.css" rel="stylesheet"/>
    	<link href="/admin/newTemplate/css/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
	    <link href="/admin/newTemplate/css/inspinia.css" rel="stylesheet"/>
	    <link href="/admin/newTemplate/css/style.css" rel="stylesheet"/>
	      <link rel="stylesheet" type="text/css" href="${request.getContext }/admin/css/xcConfirm.css"/>
		<script src="/admin/My97/WdatePicker.js"></script>
		<style>
	    	.icheckbox_square-green{
	    		float:left;
	    	}
	    	table a{
				color:#fff !important;
			}
	    </style>
<title>信息管理系统</title>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
	<script src="/admin/public/html5shiv.min.js"></script>
	<script src="/admin/public/respond.min.js"></script>
<![endif]-->

</head>
<body>
	<div id="wrapper" class="container">
			 <div id="list" class="wrapper wrapper-content animated fadeInRight">
		   		<h3> 
						 提现审核
			    </h3>
		            <div class="right_box">
		            	<form action="/admin/Member/money" class="form-horizontal">
						<div class="form-group">
						<label class="col-lg-1 col-md-1 col-sm-1 control-label" for="">
							用户姓名：</label>
						<div
							class="col-lg-2 col-md-2 col-sm-2 chosen-container chosen-container-single">
							<input type="text" class="form-control" name="num" id="num"
								value="${num }" />
						</div>
							<label class="col-lg-1 col-md-1 col-sm-1 control-label" for="">
							状态：</label>
						<div
							class="col-lg-2 col-md-2 col-sm-2 chosen-container chosen-container-single">
							<select  class="select2_demo_1 form-control" name="applystatus"
								id="applystatus">
								<option value="">--请选择--</option>
								<option value="0" ${applystatus=='0'?'selected':'' }>待审批</option>
								<option value="1" ${applystatus=='1'?'selected':'' }>已完成</option>
							</select>
						</div>
							
							<div style="width:560px;float:left;">
			            		<label for="" class="control-label" style="width:120px;float:left;">申请时间范围：</label>
			            		<img style="position: relative;left:-29px; top: 6px" src="/admin/img/datePicker.gif"/>
			            			<input type="text" placeholder="开始时间" style="width:175px;float:left;" id="startTime" name="startTime" value="${startTime }" class= "form-control" onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd'})" /><img style="position: relative;left:-260px; top: 6px" src="/admin/img/datePicker.gif"/>
			            			<span style="float:left; margin-top: 5px">——</span>
			            			<input type="text" placeholder="结束时间" style="width:175px;float:left; margin-left: 3px" id="endTime" name="endTime" value="${endTime }" class="form-control" onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd'})" />
									<input style="display:inline-block;float:right;width:82px;height:34px;" type="submit" value="搜索" class="col-lg-3 btn btn-success" />
			            		</div>
						</div>
					</form>
		            	
		            	<!--表格部分-->
		            	<div class="ibox-content" style="margin-top:20px;">
		            	<div class="row">
	                        <div class="col-sm-12">
		                    	<table class="table table-striped table-bordered table-hover dataTables-example" >
				            		<thead>
				            			<tr>
				            				<th>微信昵称</th>
										    <th>姓名</th>
										    <th>电话号码</th>
										    <th>申请时间</th>
										    <th>费用金额</th>
 										    <th>状态</th>
										    <th>提现方式</th>
										    <th>操作</th>
				            			</tr>
				            		</thead>
				            		<tbody>
				            		<c:forEach items="${list }" var="li">
										<tr>
											<td>${li.userName }</td>
											<td>${li.realname }</td>
										    <td>${li.telenumber }</td>
										     <td><fmt:formatDate type="time" value="${li.operationTime }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
										     <td>${li.deposit }</td>
										      <c:if test="${li.applystatus==0 }">
										    <td>待审批</td>
										    </c:if>
										    <c:if test="${li.applystatus==1 }">
										    <td>已完成</td>
										    </c:if> 
										    <c:if test="${li.applystatus==2 }">
										    <td>已撤销</td>
										    </c:if> 
										    <td>线下交易</td>
										     <td>
										     <%-- <c:if test="${li.applystatus==0 }">
										     	 <a onclick="lookInfo('${li.applyId }','yes');"   class="btn btn-success btn-xs">审核</a>
										     </c:if> --%>
										     <c:if test="${li.applystatus==0 }">
										     	<a onclick="chexiao('${li.applyId }');"   class="btn btn-success btn-xs">撤销提现</a>
										     	 <a onclick="zhifu('${li.userId }','${li.applyId }','${li.deposit }');"   class="btn btn-success btn-xs">审批提现</a>
										     </c:if>
										     </td>
										</tr>
									</c:forEach>
				            		</tbody>
				            	</table>
			            	</div>
		            	</div>
		            		<form action="" id="for" name="for" method="post">
						    <input type="hidden" name="yehao" id="yin" value="1"/>
						    <input type="hidden" name="pagesize" id="tiaoshu" value="${page.pageSize }"/>
						    <div class="fy"><span style="float:left;">每页条数：</span>
						      <select style="width: 70px; float: left;" onchange="changeItem(this.value)" id="pagesize" name="pageSize">
						      	<option value="10" ${page.pageSize==10?'selected':'' }>10</option>
						      	<option value="20" ${page.pageSize==20?'selected':'' }>20</option>
						      	<option value="50" ${page.pageSize==50?'selected':'' }>50</option>
						      	<option value="100" ${page.pageSize==100?'selected':'' }>100</option>
						      	<option value="200" ${page.pageSize==200?'selected':'' }>200</option>
						      </select>
						    <div style="height:27px;" class="col-sm-7">
			            			<div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
			            				<ul class="pagination pull-right" style="margin:-3px 0;">
			            					<li class="paginate_button previous" id="editable_previous">
			            						<a href="javascript:han(${page.pageNow-1 })" aria-controls="editable" data-dt-idx="0" tabindex="0">上一页</a>
			            					</li>
			            					<li class="paginate_button previous" id="editable_previous">
			            						<a  aria-controls="editable" style="border: 0" data-dt-idx="0" tabindex="1"><input type="text" id="current" style="width: 32px;height: 19px; text-align: center;" value="${page.totalPageCount==0?0:page.pageNow}"/> / ${zong }</a>
			            					</li>
			            					<li class="paginate_button previous" id="editable_previous">
			            						<a href="javascript:han(${page.pageNow+1 })" aria-controls="editable" data-dt-idx="0" tabindex="5">下一页</a>
			            						<a href="javascript:han($('#current').val())" aria-controls="editable" data-dt-idx="0" tabindex="5">跳转</a>
			            					</li>
			            				</ul>
			            			</div>
			            		</div>
			            			<div style="float:right;">总共${page.totalCount }条</div>
						    </div>
						    
						    </form>
		            	</div>	
		            </div>
		    </div>
		</div>
		<script src="/admin/newTemplate/js/jquery-2.1.1.js"></script>
	<script src="/admin/newTemplate/js/bootstrap.min.js"></script>
	<script src="/admin/newTemplate/js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script src="/admin/newTemplate/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="/admin/newTemplate/js/inspinia.js"></script>
	<script src="/admin/newTemplate/js/plugins/pace/pace.min.js"></script>
    <script src="/admin/newTemplate/js/plugins/iCheck/icheck.min.js"></script>
    <script src="/admin/newTemplate/js/plugins/sweetalert/sweetalert.min.js"></script>
      <script src="${request.getContext }/admin/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script> 
	<script>
	function lookInfo(applyId,sta){
		window.wxc.xcConfirm("确认进行此操作吗？", window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){ 
		var applystatus;
		if(sta=='yes'){
			applystatus=1
		}
		if(sta=='no'){
			applystatus=0
		}
		$.ajax({
			type : "post",
			url : "/system/check",
			data : {
				"applyId":applyId,"applystatus":applystatus},
			dataType : "json",
			success:function(data) {
				 window.wxc.xcConfirm(data.msg, window.wxc.xcConfirm.typeEnum.info,
						{onOk:function(){window.location.href = "/system/money?num="+document.all.num.value+"&applystatus="+document.all.applystatus.value+"&startTime="+document.all.startTime.value+"&endTime="+document.all.endTime.value;}}) 
			},
			error : function(data) {
				alert(data.msg);
			}
		});
		
		}})
		
		
	}
	function han(pn){
		document.getElementById("yin").value=pn;
		var biao=document.getElementById("for");
		document.for.action="/admin/Member/money?num="+document.all.num.value+"&applystatus="+document.all.applystatus.value+"&startTime="+document.all.startTime.value+"&endTime="+document.all.endTime.value;
		biao.submit();
	}
	function changeItem(size) {
		document.getElementById("tiaoshu").value=size;
		var biao=document.getElementById("for");
		biao.submit();
	 }
	//文件导出
	$("#daochu").click(function(){
			window.location.href="/system/exportmoney?num="+document.all.num.value+"&applystatus="+document.all.applystatus.value+"&startTime="+document.all.startTime.value+"&endTime="+document.all.endTime.value;
	})
	
	function zhifu(userId,applyId,deposit){
		window.wxc.xcConfirm("点击确定后请对用户进行线下转账,确定操作吗?", window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){ 
		window.location.href="/admin/Member/zhifu?userId="+userId+"&applyId="+applyId+"&deposit="+deposit;
		}})
	}
	//撤销提现
	function chexiao(applyId){
		window.wxc.xcConfirm("点击确定后用户账户回复正常使用,确定撤销吗?", window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){ 
		window.location.href="/admin/Member/chexiao?applyId="+applyId;
		}})
	}
	
	
	
	
	 //过滤空格
	 function ignoreSpaces(string) {
			var temp = "";
			string = '' + string;
			splitstring = string.split(" ");
			for(i = 0; i < splitstring.length; i++)
			temp += splitstring[i];
			return temp;
			}
	 //清空
	 function qingkong(){
		 $("#num").val("");
		 $("#applystatus").val("");
		 $("#startTime").val("");
		 $("#endTime").val("");
	 }
	</script>
</body>
</html>
